UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NqFPx7yVEJaSsTF3/6+r62EJ5OIlY0pDneJ/NKgzZfI=' 
WHERE 
  key_id = '0d575e724c9491a7341726cb08e76093ae65577aa76dbf81afd8ca4895bc8938' 
  AND (
    token = 'NqFPx7yVEJaSsTF3/6+r62EJ5OIlY0pDneJ/NKgzZfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029