UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xu93tOrGHQhUKwBdq866zCz6EKguvaEW4dcZ5vsSM8E='
WHERE
key_id = '3ed67620d848395e4502c395eb78582b7a2cec3a4c970a04c33688069332ebde'
AND (
token = 'xu93tOrGHQhUKwBdq866zCz6EKguvaEW4dcZ5vsSM8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)