UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1n4oUhvnKgHEXAR42eke1VVLdwjJxPngO4I/cocug1I=' 
WHERE 
  key_id = '055a8c022a5bbec827ed581bb9ac68232ced887586c329a4ab10ea7aeba49879' 
  AND (
    token = '1n4oUhvnKgHEXAR42eke1VVLdwjJxPngO4I/cocug1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032