UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'giIHtaDxc9KayP/iCGFhTeClZkZMFD0Msn+3/rF+HbU=' 
WHERE 
  key_id = 'c62f7a0f91e0e221f2f9c970393cb2cf0eb00a2549e19ba473e4cf1bbda1a316' 
  AND (
    token = 'giIHtaDxc9KayP/iCGFhTeClZkZMFD0Msn+3/rF+HbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076