UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sG9ZogKKLLd81W+/g2Im9bj/Eh7emjhwwL9lFb2OlCQ='
WHERE
key_id = '3b5c004020b674665aec230f499f2edf9a117b30dead4c02d443d564e7381044'
AND (
token = 'sG9ZogKKLLd81W+/g2Im9bj/Eh7emjhwwL9lFb2OlCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)