UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1uxQ3l/fdh/dZkHtTLxX9UMZ9g4wFNzoDL+0Ea016uE=' 
WHERE 
  key_id = 'a442775c8c6674a6230f715289de94df8d2e40ec20de27a53022b77f2a5fe429' 
  AND (
    token = '1uxQ3l/fdh/dZkHtTLxX9UMZ9g4wFNzoDL+0Ea016uE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019