UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aGCDXACzFKh1jRCvuhSfu4AowsLY+nLzxYWoK7Fj5nY=' 
WHERE 
  key_id = '3995eb8a4d40fbf74a1ed9812039e62fe3fac69cb6a43e1b51910f9d81970b34' 
  AND (
    token = 'aGCDXACzFKh1jRCvuhSfu4AowsLY+nLzxYWoK7Fj5nY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059