UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm+mlRf6s9YuQZceYXpn/Qq8NgnR0LDJzECKzRZEGLNk=' 
WHERE 
  key_id = '3c8dffdab9a612110215ae496aa88eb6ef20ee6d080db98e695323ebf337624a' 
  AND (
    token = 'm+mlRf6s9YuQZceYXpn/Qq8NgnR0LDJzECKzRZEGLNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041