UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mishk2hLYhmyThnk2g+Z8N9LCKF3VptVIzMfdTc+DsI='
WHERE
key_id = '0fd3dd7aa78e1e70fa0bc2ee5254892c09246c49b649356f7f5b10ad2df5e3fa'
AND (
token = 'Mishk2hLYhmyThnk2g+Z8N9LCKF3VptVIzMfdTc+DsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)