UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kjJoGZ5QssG8rrUzIMnzDlILpkiZPcwbXC8Q0XW/B5I=' 
WHERE 
  key_id = '98b42dd58fd5d31c416c70e55d01671b4ab8b36c79bde0834b96509128eb45b4' 
  AND (
    token = 'kjJoGZ5QssG8rrUzIMnzDlILpkiZPcwbXC8Q0XW/B5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054