UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZKPj1cnJ1iS+4wcLgkHNzKV7IbVA7yNBMUtB10f2gJw=' 
WHERE 
  key_id = '26fbc432600410bd3bc19746036d5bc45012eb9ce3ef11178f94513ed60fc14d' 
  AND (
    token = 'ZKPj1cnJ1iS+4wcLgkHNzKV7IbVA7yNBMUtB10f2gJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022