UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bvSRF3UJAYgAXLf02KhKZe58thEUTgQrbQT1V2UGQzc='
WHERE
key_id = '76b93323754b26b7501951fc7d475d767402763e0fd1fac4d108175ebf1f59e9'
AND (
token = 'bvSRF3UJAYgAXLf02KhKZe58thEUTgQrbQT1V2UGQzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)