UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5g6zEV9nof6ab3KaZ2GdSAo7fsjnCBfzHKQp50upIXU='
WHERE
key_id = 'dc0b53d002ef2b61a25c32b80ed0298dd6c444cf33267cd5836d1fa37be8812e'
AND (
token = '5g6zEV9nof6ab3KaZ2GdSAo7fsjnCBfzHKQp50upIXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)