UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8VnJq2NRdvg7V92QrMBSakKjkv1DRffrhZOXVZyh8zA=' 
WHERE 
  key_id = '097cecfa78d855127dcb14ed3d4e4b9e1cd84b9e1f28543fa5c6d4612b0b80a8' 
  AND (
    token = '8VnJq2NRdvg7V92QrMBSakKjkv1DRffrhZOXVZyh8zA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035