UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HSCF2/xp/pej478h2wxCyQAzRn4eCiHnTu5ZuIS/k/U=' 
WHERE 
  key_id = '8a14327fb23b19c3cc3396e90407424585ac2f710918d481ac3dcf2c75b71334' 
  AND (
    token = 'HSCF2/xp/pej478h2wxCyQAzRn4eCiHnTu5ZuIS/k/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042