UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AzIVPegLuVxVodcQparwFSjcNsIN8EPvX696ONtnZ0Y='
WHERE
key_id = 'ec719fe777197af62294dd6c4e091412af4d722e5f6e17bad18c2dffe8bbd726'
AND (
token = 'AzIVPegLuVxVodcQparwFSjcNsIN8EPvX696ONtnZ0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)