UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p3VYi3x3iJnGoX8wDcE1hJg+pKYSzoQMyPiEB1ZPpOw=' 
WHERE 
  key_id = 'f2a2f44ead8095ab8e4d92f6ccca2d3c85197189800d7e4221f0ed879eb4eaac' 
  AND (
    token = 'p3VYi3x3iJnGoX8wDcE1hJg+pKYSzoQMyPiEB1ZPpOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026