UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pRwt4QGn5rpU9e3pl765eYIlO0C62yzEepz5QFrHSfs='
WHERE
key_id = '94449de1b3d93484b3dca442f57de01dbc1d8a82dcf2bda8c4339a223e601d8e'
AND (
token = 'pRwt4QGn5rpU9e3pl765eYIlO0C62yzEepz5QFrHSfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)