UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IifpxyRISZIZ7Sk38/WylW5lLBFV3tfoJsSbF/KUSd4='
WHERE
key_id = 'a692392622c9d6a9d78dfd9879e7931bdd9b1e8a4d883a20e5acfa2b3f112735'
AND (
token = 'IifpxyRISZIZ7Sk38/WylW5lLBFV3tfoJsSbF/KUSd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)