UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ReXU2nHZHDo6hIo0aVTRo50E9fU+9KprtswLqKUvwxA=' 
WHERE 
  key_id = '703ddcd29c8dffd538fc492bec13e5a3a7d00082ec0eb5951fffc78bf1072cc0' 
  AND (
    token = 'ReXU2nHZHDo6hIo0aVTRo50E9fU+9KprtswLqKUvwxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036