UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7/HFe+qHIFCVpuqvxDJ5Uf50PDTSYv0Jarbo+HeAOE='
WHERE
key_id = '4eda28d24302e7116a5577c2b5c3dd817dfb9bb0ac49cf7ee057f26d256963fa'
AND (
token = 'R7/HFe+qHIFCVpuqvxDJ5Uf50PDTSYv0Jarbo+HeAOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)