UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qITsjIy6tSZAS8VqV7Qd3tC58lQy/GGjWg2w7IM4r08='
WHERE
key_id = '2a82ff5ac1ba04087b0722c4a9722174df5f7d7748fee2806dc0219752e37881'
AND (
token = 'qITsjIy6tSZAS8VqV7Qd3tC58lQy/GGjWg2w7IM4r08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)