UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3U9BB1ufMIf8Qf9zgMUUd9Gh1xJpNMS/JLgFe0WtcQA='
WHERE
key_id = '3b85102f2e088b04d23810aa2b69037ce5fe40d535bb74513b37111cf8227838'
AND (
token = '3U9BB1ufMIf8Qf9zgMUUd9Gh1xJpNMS/JLgFe0WtcQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)