UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fVj0PvHZXUpxtKDaPgTnwThM8P3FYdGecdSx3/X0UeU=' 
WHERE 
  key_id = '11da6e80840f00316af6e9cd6da8a0894c47b1fe2b5737fa3a4e62ea31050118' 
  AND (
    token = 'fVj0PvHZXUpxtKDaPgTnwThM8P3FYdGecdSx3/X0UeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045