UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aWHI4NpnYmGhUdkRwWF32AkNJzCP5MKGp/rNCLzya3w=' 
WHERE 
  key_id = 'b6365a258c059683ce259ce9241af8eb07b4a6d3ee3a54b2cac969920b9772a1' 
  AND (
    token = 'aWHI4NpnYmGhUdkRwWF32AkNJzCP5MKGp/rNCLzya3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036