UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GoslWnw1VwCpRmtJKueI5syDdgYHwYh0TZoUD9+xPAQ=' 
WHERE 
  key_id = '12a7a0f4a7ad0a4ecb13ac457f724753fc4f2b19d2c560f0c53003c98ae9be61' 
  AND (
    token = 'GoslWnw1VwCpRmtJKueI5syDdgYHwYh0TZoUD9+xPAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028