UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MQvtr97SHSKgMT5t+0tHuBnNOCIZ0zeDq7vldL8vj8M=' 
WHERE 
  key_id = '72ec1de7b01ec078864c34b4eb96ea8c86c099a7709b9d1952de0947fd2ef534' 
  AND (
    token = 'MQvtr97SHSKgMT5t+0tHuBnNOCIZ0zeDq7vldL8vj8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030