UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RIYNMY0P328GZvzLG41ZuN/WXOV3h3H4ip6sMhMVmWI='
WHERE
key_id = 'a410ef610fcb8f5b5884d83f0a670b80993c3e22b1d34882fa05cdd00d8a94d8'
AND (
token = 'RIYNMY0P328GZvzLG41ZuN/WXOV3h3H4ip6sMhMVmWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)