UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F/nSdgXBldzn+YQR2N5YbzIIgTnPGtXCUzOEh7SFOec='
WHERE
key_id = '93e3a5904433753940d3de9090bc2ac21503bda6faff2a038d729237c39b9e0d'
AND (
token = 'F/nSdgXBldzn+YQR2N5YbzIIgTnPGtXCUzOEh7SFOec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)