UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mJhe+avi0dlZxFuz31xYGOa30lvaZsr1r/qmhb3E3co='
WHERE
key_id = 'bcb634de36d64042302d6510c43a5badc26e320862a2c02f1ba91f27f7b81b5a'
AND (
token = 'mJhe+avi0dlZxFuz31xYGOa30lvaZsr1r/qmhb3E3co='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)