UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iAQPV94qx3RZxzm29ZFLQp9tQEIENa4X9CYTIrhbkP4='
WHERE
key_id = '014b55893c7d943c9dfdb751543634c019263d334a22af69a6c4e1e802311521'
AND (
token = 'iAQPV94qx3RZxzm29ZFLQp9tQEIENa4X9CYTIrhbkP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)