UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pVZLIB7rNbdZPaOYXNOJjVRrk9EMP+IwVc6c/ItYk+M=' 
WHERE 
  key_id = '7dcbfa418926b9ef3669e24f210ab6f92382c0620d7ea33e4ff94d6a33714dcd' 
  AND (
    token = 'pVZLIB7rNbdZPaOYXNOJjVRrk9EMP+IwVc6c/ItYk+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027