UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E0naBv1kv5L6qFtBIQKVtL41pbDZlhPUHxfjnn3ypLI=' 
WHERE 
  key_id = '79037311ed0828338bac425d8b4e1504e2504278e9ec58e268c06d8079d31343' 
  AND (
    token = 'E0naBv1kv5L6qFtBIQKVtL41pbDZlhPUHxfjnn3ypLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028