UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1f+DyANCqWgLnyd35Jk+hpu6Sql5sZnerlWwj03QKTs=' 
WHERE 
  key_id = 'e22f22eb8209a1711704859199f7f6b8120ca725940687de14bc3909ea505a33' 
  AND (
    token = '1f+DyANCqWgLnyd35Jk+hpu6Sql5sZnerlWwj03QKTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030