UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sM8E0BGPymiJ8/rou8Ww1Exkw1b4wMDaQRtFaTJMWvo='
WHERE
key_id = '868459ef5fade6b9821fa6f3338cc8d99b602c5485187aa06dc6a64c94868aa3'
AND (
token = 'sM8E0BGPymiJ8/rou8Ww1Exkw1b4wMDaQRtFaTJMWvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)