UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dMBmslHQCePEkTFrpGHxGXhxKpDh/zeYdYvgixPLvLk=' 
WHERE 
  key_id = '63d1c43888f8fa77154466cbf802604d1c7465e0321a72dfa37fc89d13dad7ed' 
  AND (
    token = 'dMBmslHQCePEkTFrpGHxGXhxKpDh/zeYdYvgixPLvLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047