UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Za42fzSsxgrOkvSX4xoXrDjp5XfLwjToMFVD7Yf+xfI=' 
WHERE 
  key_id = '76f7be674bac36782f18a3d0bfc978086bc5ffdd01f1ff29e22b7a967d884ae5' 
  AND (
    token = 'Za42fzSsxgrOkvSX4xoXrDjp5XfLwjToMFVD7Yf+xfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037