UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MHEgHU7MQAa9IbC0YzUpbvxiGqaPlO5VRP8BU7BrrCE='
WHERE
key_id = 'd04a3569902798d93ace055e6ac9cb72fbd3c20c7cdad9a67c65b4003e6e3977'
AND (
token = 'MHEgHU7MQAa9IbC0YzUpbvxiGqaPlO5VRP8BU7BrrCE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)