UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Um7Bg1iAYKpabR5Z4cp0y+kR3ROp2wHSbX/8O8iTjbA=' 
WHERE 
  key_id = '60bf7d5c752332c482fed0a828e573fd87fa66645eb3048ff75abee57c63502c' 
  AND (
    token = 'Um7Bg1iAYKpabR5Z4cp0y+kR3ROp2wHSbX/8O8iTjbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033