UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UQgWb+S5q5m/HSkU2S+4EdMPxnz3oqYH1dtnEMRwj/0='
WHERE
key_id = 'e22e2c57a76cbcd0408848cbc2c0bb008ea95d21cb709269eda329c5c6de9848'
AND (
token = 'UQgWb+S5q5m/HSkU2S+4EdMPxnz3oqYH1dtnEMRwj/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)