UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e2qOd5hYLNb+27PwwWPPeKeg1cw+hW3/Xo/0yb5JJVs=' 
WHERE 
  key_id = '7e71ad4c3f9e7c6f4775f2296809b8c8825029278b6467643ba2b7169d77d918' 
  AND (
    token = 'e2qOd5hYLNb+27PwwWPPeKeg1cw+hW3/Xo/0yb5JJVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016