UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F9DsFLP2WY6iraJUUmDmFM4E5/+KVJ6+Z6nLufSSYmQ='
WHERE
key_id = '8138a445a062c98354577b87ca191d806f618b47bb5e158de96ea9d32e0a7e19'
AND (
token = 'F9DsFLP2WY6iraJUUmDmFM4E5/+KVJ6+Z6nLufSSYmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)