UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZ+8a8fukY6Q1/tLFhCMgO/OAW01y74nUUVFNfhsFpg='
WHERE
key_id = 'a3fa16a55058289adc95287627e21329bddbe4181a8ec0281cfd2b56ea0e9632'
AND (
token = 'rZ+8a8fukY6Q1/tLFhCMgO/OAW01y74nUUVFNfhsFpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)