UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ne7QBvIRiIVD66ZInVXbPXZhuoOi3aYWTFG/aloWc2A='
WHERE
key_id = 'acc2ac41edafe92cdd4f6dc4886f29af57d187353ffd34ad564d7ca6cead6986'
AND (
token = 'Ne7QBvIRiIVD66ZInVXbPXZhuoOi3aYWTFG/aloWc2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)