UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U5fKWJ8XF/PQJnuB+wnOS7M8yUNFnkIm+pSVJMzjuFI=' 
WHERE 
  key_id = '3eef444cbc0cc208e337745c9a7b1fba8b475faaa608930e3b87cbc1f8094ce3' 
  AND (
    token = 'U5fKWJ8XF/PQJnuB+wnOS7M8yUNFnkIm+pSVJMzjuFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024