UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QaVsOdXw0fFgwCwfoI8k4YKkB2pZgJSsGKHYa79Vzu8=' 
WHERE 
  key_id = '674562c7e0c6ba744bd9579f291fdac0a453bde24c9669e73508c39d5687dea8' 
  AND (
    token = 'QaVsOdXw0fFgwCwfoI8k4YKkB2pZgJSsGKHYa79Vzu8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030