UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'As5g8HOF56O+I6yFwjILsPR5I+oGvDDQTnhWz58XuKg='
WHERE
key_id = 'f4725ad68f132d9e2550336966fc6b255fdc756785972d910c76f34c9f01f2b5'
AND (
token = 'As5g8HOF56O+I6yFwjILsPR5I+oGvDDQTnhWz58XuKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)