UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yehQq394DE1lqo/z5lMsliOIIk9C/kDgYH1ZUfto6wc='
WHERE
key_id = 'd80fb8456f145c331aa2b8ccbbfefe39688d1f9b27f5a47750c3263f237fdbed'
AND (
token = 'yehQq394DE1lqo/z5lMsliOIIk9C/kDgYH1ZUfto6wc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)