UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0EC3+KrMiFZXSx15/jLyPLQMQZ6rWn+y06WvkMidwbA=' 
WHERE 
  key_id = 'eca497b5211b8f9f8b2465cb5c2b537a7cfd94d6b1d63346b8630f39b87c1ab9' 
  AND (
    token = '0EC3+KrMiFZXSx15/jLyPLQMQZ6rWn+y06WvkMidwbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017