UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G0kIm2j+3sMqHCfgocKGfnRi6JP31+KHtSCLnVIhPU0='
WHERE
key_id = '956efceb3ce210380244f37363874d414589f13a7bcd55d680b78d1a3b9b62df'
AND (
token = 'G0kIm2j+3sMqHCfgocKGfnRi6JP31+KHtSCLnVIhPU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)