UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vk7AG401y+VYvCzxhkiTzVRKCz6OgMzp7yVBFWSpjCs=' 
WHERE 
  key_id = '33097ef0fac0a250153d372d0bd7e3c91dbcf452ece7f03f28d219f87401f5e8' 
  AND (
    token = 'vk7AG401y+VYvCzxhkiTzVRKCz6OgMzp7yVBFWSpjCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036